<template>
  <div class="battery">
    <div id="top"></div>
    <div id="btm">
      <div class="electric" ref="power" :style="`height: ${num}%`"></div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'IsBattery',
  props: {
    num: {
      type: Number,
      default: 0
    }
  }
}
</script>

<style scoped>
.battery {
  height: 50px;
  width: 30px;
  overflow: hidden;
  line-height: 50px;
  text-align: center;
  margin: auto;
  text-transform: uppercase;
  transform: rotate(90deg);
}
.battery #top {
  border-top-left-radius: 2px;
  border-top-right-radius: 2px;
  background-color: #fbecac;
  height: 3px;
  width: 10px;
  margin: auto;
}
.battery #btm {
  border-radius: 2px;
  border: 2px solid #fbecac;
  height: 44px;
  width: 24px;
  margin: auto;
  transform: rotate(180deg);
}
.electric {
  background-color: green;
}
</style>
